# Maintainer: Ryuta Suzuki <oroppas@gmail.com>

_realname=ipython_genutils
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}" "${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=0.2.0
pkgrel=1
pkgdesc="IPython vestigial utilities (mingw-w64)"
url="https://github.com/ipython/ipython_genutils"
arch=('any')
license=('Modified BSD')
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools"
             "${MINGW_PACKAGE_PREFIX}-python2-setuptools")
source=(${_realname}-${pkgver}.tar.gz::https://github.com/ipython/${_realname}/archive/${pkgver}.tar.gz)
sha256sums=('424a6ecb33b8c9a8320f8601c533067ed75b491e4bc31621d6278f288497cb1a')


prepare() {
  cp -a ${_realname}-${pkgver}{,-py2}
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  python3 setup.py build

  cd ${srcdir}/${_realname}-${pkgver}-py2
  python2 setup.py build
}

package_python3-ipython_genutils() {
  depends=("${MINGW_PACKAGE_PREFIX}-python3")

  cd ${srcdir}/${_realname}-${pkgver}
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python3 setup.py install --root=${pkgdir} --prefix=${MINGW_PREFIX} --optimize=1
}

package_python2-ipython_genutils() {
  depends=("${MINGW_PACKAGE_PREFIX}-python2")

  cd ${srcdir}/${_realname}-${pkgver}-py2
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python2 setup.py install --root=${pkgdir} --prefix=${MINGW_PREFIX} --optimize=1
}

package_mingw-w64-i686-python2-ipython_genutils() {
  package_python2-ipython_genutils
}

package_mingw-w64-i686-python3-ipython_genutils() {
  package_python3-ipython_genutils
}

package_mingw-w64-x86_64-python2-ipython_genutils() {
  package_python2-ipython_genutils
}

package_mingw-w64-x86_64-python3-ipython_genutils() {
  package_python3-ipython_genutils
}

# vim:set ts=2 sw=2 et:
